Namesilo Bulk Domain Availability [Template]
工作流概述
这是一个包含10个节点的复杂工作流,主要用于自动化处理各种任务。
工作流源代码
{
"id": "phqg5Kk3YowxoMHQ",
"meta": {
"instanceId": "3b02b4d565b70d8766b64aa225626d46b11a527d9f5fe390a8405f2a09e8b8a4"
},
"name": "Namesilo Bulk Domain Availability [Template]",
"tags": [
{
"id": "28jVdgW1S4XWqLH4",
"name": "Templates",
"createdAt": "2025-02-28T12:22:07.921Z",
"updatedAt": "2025-02-28T12:22:07.921Z"
}
],
"nodes": [
{
"id": "b1184b35-0ab4-42d8-a5b2-66ef926d7eed",
"name": "Set Data",
"type": "n8n-nodes-base.set",
"position": [
-240,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "05a34cf0-9462-4684-aac8-32b4b17e9ef0",
"name": "Domains",
"type": "string",
"value": "=domain1.com
domain2.com
domain3.com"
},
{
"id": "438830f9-27fe-4e89-bcb9-766483e2d9b1",
"name": "Namesilo API Key",
"type": "string",
"value": "YOUR_API_KEY"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "7fc40d31-a43b-4273-a6eb-d519fda815d4",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-800,
-340
],
"parameters": {
"width": 580,
"height": 280,
"content": "## How-To
1. Claim your free Namesilo API key here: https://www.namesilo.com/account/api-manager
2. Set your API key and domains in \"Set Data\" node.
The workflow send up to 200 domains per loop until all domains are processed. The output is in Excel format.
Enjoy!
Note: Each loop wait 5min. This is required due to Namesilo rate limits."
},
"typeVersion": 1
},
{
"id": "a2137f76-9e08-4743-b914-b10bbebc9a13",
"name": "Convert & Split Domains",
"type": "n8n-nodes-base.code",
"position": [
-60,
0
],
"parameters": {
"jsCode": "// Get domains from input JSON
const domains = $json.Domains.split(\"\n\").map(domain => domain.trim()).filter(Boolean);
// Define batch size
const batchSize = 200;
// Split into batches of 200
let batches = [];
for (let i = 0; i < domains.length; i += batchSize) {
batches.push(domains.slice(i, i + batchSize).join(\",\"));
}
// Return batches as an array
return batches.map(batch => ({ batchedDomains: batch }));"
},
"typeVersion": 2
},
{
"id": "41140017-1f98-4ea9-ac97-9d48e5bdfda1",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"position": [
680,
-200
],
"webhookId": "3ede79a2-7875-462f-b15a-1c74339e2a8a",
"parameters": {
"unit": "minutes"
},
"typeVersion": 1.1
},
{
"id": "9aa9ddb5-9091-4726-917c-bce9d0f207c9",
"name": "Merge Results",
"type": "n8n-nodes-base.code",
"position": [
320,
0
],
"parameters": {
"jsCode": "// This re-maps each input item (if needed)
const newItems = items.map(item => ({
json: {
Domain: item.json.Domain,
Availability: item.json.Availability
}
}));
return newItems;"
},
"typeVersion": 2
},
{
"id": "bb2fd210-fd11-4712-94d0-fabb7060705c",
"name": "Loop Over Domains",
"type": "n8n-nodes-base.splitInBatches",
"position": [
120,
0
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "5d97cd82-f7d5-4f98-a789-8c0fcf473f0f",
"name": "Namesilo Requests",
"type": "n8n-nodes-base.httpRequest",
"position": [
320,
-200
],
"parameters": {
"url": "=https://www.namesilo.com/apibatch/checkRegisterAvailability?version=1&type=json&key={{ $('Set Data').item.json['Namesilo API Key'] }}&domains={{ $json.batchedDomains }}",
"options": {}
},
"retryOnFail": true,
"typeVersion": 4.2,
"waitBetweenTries": 5000
},
{
"id": "c4f38893-636a-4293-9e10-395be30683d0",
"name": "Parse Data",
"type": "n8n-nodes-base.code",
"position": [
500,
-200
],
"parameters": {
"jsCode": "// Ensure input data exists
if (!$json || !$json.data) {
throw new Error(\"Invalid input data format\");
}
// Parse the JSON string inside `data`
let parsedData;
try {
parsedData = JSON.parse($json.data);
} catch (error) {
throw new Error(\"Error parsing JSON data: \" + error.message);
}
// Extract available and unavailable domains safely
const availableDomains = parsedData.reply?.available ? Object.values(parsedData.reply.available) : [];
const unavailableDomains = parsedData.reply?.unavailable ? Object.values(parsedData.reply.unavailable) : [];
// Prepare the output array
const output = [];
// Process available domains
availableDomains.forEach(domainObj => {
if (domainObj && domainObj.domain) {
output.push({
Domain: domainObj.domain,
Availability: \"Available\"
});
}
});
// Process unavailable domains
unavailableDomains.forEach(domain => {
if (typeof domain === \"string\") {
output.push({
Domain: domain,
Availability: \"Unavailable\"
});
} else if (typeof domain === \"object\" && domain.domain) {
output.push({
Domain: domain.domain,
Availability: \"Unavailable\"
});
}
});
// Return the structured data
return output;"
},
"typeVersion": 2
},
{
"id": "ec7b8311-65b7-45b0-85ae-b91d7c82e123",
"name": "Convert to Excel",
"type": "n8n-nodes-base.convertToFile",
"position": [
500,
0
],
"parameters": {
"options": {
"fileName": "domain_results.xlsx"
},
"operation": "xlsx",
"binaryPropertyName": "={{ $json.MergedDomains }}"
},
"typeVersion": 1.1
},
{
"id": "7d33c875-ce2d-404c-97a0-f551939d59f4",
"name": "Start",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-420,
0
],
"parameters": {},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "1a05d4b0-db0c-4554-8abf-0547130be16c",
"connections": {
"Wait": {
"main": [
[
{
"node": "Loop Over Domains",
"type": "main",
"index": 0
}
]
]
},
"Start": {
"main": [
[
{
"node": "Set Data",
"type": "main",
"index": 0
}
]
]
},
"Set Data": {
"main": [
[
{
"node": "Convert & Split Domains",
"type": "main",
"index": 0
}
]
]
},
"Parse Data": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Merge Results": {
"main": [
[
{
"node": "Convert to Excel",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Domains": {
"main": [
[
{
"node": "Merge Results",
"type": "main",
"index": 0
}
],
[
{
"node": "Namesilo Requests",
"type": "main",
"index": 0
}
]
]
},
"Namesilo Requests": {
"main": [
[
{
"node": "Parse Data",
"type": "main",
"index": 0
}
]
]
},
"Convert & Split Domains": {
"main": [
[
{
"node": "Loop Over Domains",
"type": "main",
"index": 0
}
]
]
}
}
}
功能特点
- 自动检测新邮件
- AI智能内容分析
- 自定义分类规则
- 批量处理能力
- 详细的处理日志
技术分析
节点类型及作用
- Set
- Stickynote
- Code
- Wait
- Splitinbatches
复杂度评估
配置难度:
维护难度:
扩展性:
实施指南
前置条件
- 有效的Gmail账户
- n8n平台访问权限
- Google API凭证
- AI分类服务订阅
配置步骤
- 在n8n中导入工作流JSON文件
- 配置Gmail节点的认证信息
- 设置AI分类器的API密钥
- 自定义分类规则和标签映射
- 测试工作流执行
- 配置定时触发器(可选)
关键参数
| 参数名称 | 默认值 | 说明 |
|---|---|---|
| maxEmails | 50 | 单次处理的最大邮件数量 |
| confidenceThreshold | 0.8 | 分类置信度阈值 |
| autoLabel | true | 是否自动添加标签 |
最佳实践
优化建议
- 定期更新AI分类模型以提高准确性
- 根据邮件量调整处理批次大小
- 设置合理的分类置信度阈值
- 定期清理过期的分类规则
安全注意事项
- 妥善保管API密钥和认证信息
- 限制工作流的访问权限
- 定期审查处理日志
- 启用双因素认证保护Gmail账户
性能优化
- 使用增量处理减少重复工作
- 缓存频繁访问的数据
- 并行处理多个邮件分类任务
- 监控系统资源使用情况
故障排除
常见问题
邮件未被正确分类
检查AI分类器的置信度阈值设置,适当降低阈值或更新训练数据。
Gmail认证失败
确认Google API凭证有效且具有正确的权限范围,重新进行OAuth授权。
调试技巧
- 启用详细日志记录查看每个步骤的执行情况
- 使用测试邮件验证分类逻辑
- 检查网络连接和API服务状态
- 逐步执行工作流定位问题节点
错误处理
工作流包含以下错误处理机制:
- 网络超时自动重试(最多3次)
- API错误记录和告警
- 处理失败邮件的隔离机制
- 异常情况下的回滚操作